import request from '@/utils/request'
/**
 * @description 查询所有笔记
 */
export const getNoteList = () => {
  return request.get('note')
}
/**
 * @description 添加笔记
 * @param {Object} note 添加的笔记内容
 */
export const createNote = (note) => {
  return request.post('note', note)
}
/**
 * @description 删除笔记
 * @param {Number} id 删除笔记的id值
 */
export const deleteNote = id => {
  return request.delete(`note/${id}`)
}
/**
 * @description 根据id查询笔记
 * @param {Number} id 查询笔记的id值
 */
export const getNoteById = id => {
  return request.get(`note/${id}`)
}
/**
 * @description 修改笔记
 * @param {Number} id 修改的笔记的id
 * @param {Object} note 修改后的笔记
 */
export const updateNote = (id, note) => {
  return request.put(`note/${id}`, note)
}
